package org.sample.dao;

import org.sample.entity.Group;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by Alan.ye on 2016/10/1.
 */
public interface GroupDao extends JpaRepository<Group, Integer> {

    @Query(value = "select new org.sample.entity.Group(t.id,t.name) from org.sample.entity.Group t")
    List<Group> getIdNameList();

}